<template>
  <div class="activity">
    <div class="details">我的{{ info }} {{ data }}</div>
  </div>
</template>
          
<script  setup>
import { ref, watch } from "vue";
import { useRoute } from "vue-router";
const router = useRoute();
const data = ref(router.params.id);
let info = ref("问题");
console.log(router);
watch(
  () => router.params.id,
  (e) => {
    //在这发送请求重新获得数据
    switch (e) {
      case "0":
        info.value = "问题";
        break;
      case "1":
        info.value = "回答";
        break;
      case "2":
        info.value = "文章";
        break;
      case "3":
        info.value = "关注";
        break;
      default:
        break;
    }
    data.value = e;
  }
);
</script>

<style scoped lang="less">
.activity {
  .details {
    height: 40px;
    margin-left: 10px;
    border-bottom: 1px solid #f6f6f6;
  }
}
</style>
          